Nevron Open Vision Documentation
Nevron.Nov.DataStructures Namespace / NList<T> Class / BinarySearch Method / BinarySearch(Int32,Int32,T,IComparer<T>) Method
range start index
range lenght
item to look for
comparer to use


In This Topic
    BinarySearch(Int32,Int32,T,IComparer<T>) Method
    In This Topic
    Searches for the index at which the item occurs by using a binary search. The search is performed only inside the specified list subrange. It is an user responsibility to first sort the list in ascending order.
    Syntax
    'Declaration
     
    
    Public Overloads Function BinarySearch( _
       ByVal index As System.Integer, _
       ByVal count As System.Integer, _
       ByVal item As T, _
       ByVal comparer As System.Collections.Generic.IComparer(Of T) _
    ) As System.Integer
    'Usage
     
    
    Dim instance As NList(Of T)
    Dim index As System.Integer
    Dim count As System.Integer
    Dim item As T
    Dim comparer As System.Collections.Generic.IComparer(Of T)
    Dim value As System.Integer
     
    value = instance.BinarySearch(index, count, item, comparer)
    public System.int BinarySearch( 
       System.int index,
       System.int count,
       T item,
       System.Collections.Generic.IComparer<T> comparer
    )

    Parameters

    index
    range start index
    count
    range lenght
    item
    item to look for
    comparer
    comparer to use
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

    See Also